package com.cskaoyan.controller.wxcontroller;

import com.cskaoyan.bean.po.MarketFeedback;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.service.wxservice.FeedbackWxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:J
 * @datetime 2023/1/2 7:38
 * @description: TODO:
 * 反馈 submit 个人中心-意见反馈-提交
 */

@RestController
@RequestMapping("wx/feedback")
public class FeedbackWeChatController {

    @Autowired
    FeedbackWxService feedbackWxService;

    /**
     * http://182.92.235.201:8083/wx/feedback/submit
     * post
     * @return
     */
    @RequestMapping("submit")

    public BaseRespVo submit(@RequestBody MarketFeedback marketFeedback) {
//        ValidationUtil.valid(bindingResult);
        BaseRespVo baseRespVo=new BaseRespVo<>();
        int i=feedbackWxService.submit(marketFeedback);
        if(i!=1){
            baseRespVo.setErrno(501);
            baseRespVo.setErrmsg("需要登录");
        }
        baseRespVo.setErrmsg("成功");
        baseRespVo.setErrno(0);
        return baseRespVo;
    }

}
